#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QInputDialog>
#include <QDebug>
#include <QStringList>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int input = QInputDialog::getInt(this,"整数对话框","请输入一个整数");
    qDebug() << input;
}

void MainWindow::on_pushButton_2_clicked()
{
    double input = QInputDialog::getDouble(this,"浮点型对话框","请输入一个浮点数");
    qDebug() << input;
}

void MainWindow::on_pushButton_3_clicked()
{
    QStringList str;
    str.push_back("1111");
    str.push_back("2222");
    str.push_back("3333");
    str.push_back("4444");
    QString s = QInputDialog::getItem(this,"字符串对话框","请输入一个字符串",str);
    qDebug() << s;
}
